package com.yz.lzq.liwushuo.ui.modules.home.boutique.gridview.creditstopic;

import com.yz.lzq.liwushuo.http.OnGetNetDataListener;

/**
 * Created by Administrator on 2016/12/22.
 */

public class CreditsTopicPresenter {
    private CreditsTopicContract.CreditsTopicModelInterface modelInterface = null;
    private CreditsTopicContract.CreditsTopicViewInterface viewInterface = null;

    public CreditsTopicPresenter(CreditsTopicContract.CreditsTopicViewInterface viewInterface) {
        this.viewInterface = viewInterface;
        modelInterface = new CreditsTopicModel();
    }

    public void showGetNetWorkData() {
        modelInterface.getDetaildeInformation(viewInterface.getItemId(),viewInterface.getCurrentItemId(), new OnGetNetDataListener<String[]>() {
            @Override
            public void onGetDataSucess(String[] data) {
                viewInterface.getLikeCount(data[0]);
                viewInterface.getLShareCount(data[1]);
                viewInterface.getCommenCount(data[2]);
                viewInterface.getWebViewUrl(data[3]);
            }

            @Override
            public void onGetDataFalied(Throwable t) {

            }
        });
    }
}
